import QtQuick 2.0
import Qt3D 1.0
import Qt3D.Shapes 1.0
import "js/BlockInfo.js" as BI

Item3D{
    id: _root

    property real cursorAngle: 0
    property color cursorColor: "#ffffff"

    Behavior on y{
        NumberAnimation{ duration: 200 }
    }

    NumberAnimation {
        running: _root.enabled
        loops: Animation.Infinite
        target: _root
        property: "cursorAngle"
        duration: 5000
        from: 0
        to: 360
    }

    Cube{
        x: -1.5
        scale: 0.3
        transform:[
            Rotation3D{
                angle: 45
                axis: Qt.vector3d(0, 0, 1)
            },
            Rotation3D{
                angle: _root.cursorAngle
                axis: Qt.vector3d(0, 1, 0)
            }
        ]
        effect: Effect{
            color: _root.cursorColor
        }
    }
    Cube{
        x: 1.5
        scale: 0.3
        transform:[
            Rotation3D{
                angle: 45
                axis: Qt.vector3d(0, 0, 1)
            },
            Rotation3D{
                angle: -1 * _root.cursorAngle
                axis: Qt.vector3d(0, 1, 0)
            }
        ]
        effect: Effect{
            color: _root.cursorColor
        }
    }
}
